﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Final
{
    public partial class ucThemKH : UserControl
    {
        LIMS_LOGISTICSEntities context = new LIMS_LOGISTICSEntities();
        public ucThemKH()
        {
            InitializeComponent();
        }

        private void ucThemKH_Load(object sender, EventArgs e)
        {
            //load vao combobox linh vuc kinh doanh
            var linhvuckd = from linhvuc in context.tblSys_LINHVUCKD
                            select linhvuc;
            cbLinhvuckd.DataSource = linhvuckd.ToList<tblSys_LINHVUCKD>();
            cbLinhvuckd.DisplayMember = "LINHVUC";
            cbLinhvuckd.ValueMember = "MALINHVUC";

            //load vao combobox quoc gia
            var quocgia = from QG in context.tblSys_QUOCGIA
                            select QG;
            cbquocgia.DataSource = quocgia.ToList<tblSys_QUOCGIA>();
            cbquocgia.DisplayMember = "QUOCGIA";
            cbquocgia.ValueMember = "MAQG";

            //load vao combobox tinh thanh
            var tinhthanh = from TT in context.tblSys_TINHTHANH
                          select TT;
            cbtinhthanh.DataSource = tinhthanh.ToList<tblSys_TINHTHANH>();
            cbtinhthanh.DisplayMember = "TINHTHANH";
            cbtinhthanh.ValueMember = "MATINH";

            //load vao combobox nhân viên quản lý
            var nhavienqly = from nvql in context.lblSys_NHANVIEN
                            select nvql;
            cbnhanvienquanly.DataSource = nhavienqly.ToList<lblSys_NHANVIEN>();
            cbnhanvienquanly.DisplayMember = "TEN";
            cbnhanvienquanly.ValueMember = "MANV"; 
        }

        private void xtraTabControl1_Click(object sender, EventArgs e)
        {

        }
    }
}
